# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=gengetopt
pkgver=2.23
pkgrel=2
pkgdesc="Tool to write command line option parsing code for C programs"
url="https://www.gnu.org/software/gengetopt/"
arch="all"
license="GPL-3.0-or-later"
depends_dev="gengetopt"
makedepends="$depends_dev texinfo"
subpackages="$pkgname-doc $pkgname-dev"
source="https://ftp.gnu.org/gnu/gengetopt/gengetopt-$pkgver.tar.xz"
options="!check"

prepare() {
 	default_prepare
	update_config_sub
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="3749191d35acbeff6680f2a4d0516706a0491053f632aaa44ead7c3a42e56f9870bd7c4a85a1886f2052e17d86a2853e2f65d445e0c9920e41f1dc354f003712  gengetopt-2.23.tar.xz"
